<template>
  <basic-container class="app-container">
    <div class="worktablist">
      <span class="name" v-for="(item,index) in worktablist" :class="{active:(active==item.key)}" @click="handleTabs(item.key)"
        :key="index">{{item.name}}</span>
    </div>
    <div class="workMain">
      <div v-if="active=='Reminders'">
        <Reminders></Reminders>
      </div>
      <div v-if="active=='Complaint'">
        <Complaint></Complaint>
      </div>
      <div v-if="active=='Abnormal'">
        <Abnormal></Abnormal>
      </div>
      <div v-if="active=='ModifyOrder'">
        <ModifyOrder></ModifyOrder>
      </div>
      <div v-if="active=='Refund'">
        <Refund></Refund>
      </div>
      <div v-if="active=='Problem'">
        <Problem></Problem>
      </div>
      <div v-if="active=='ProductAppeal'">
        <ProductAppeal></ProductAppeal>
      </div>
      <div v-if="active=='ConsultHappy'">
        <ConsultHappy></ConsultHappy>
      </div>
      <div v-if="active=='ModifyGoods'">
        <ModifyGoods></ModifyGoods>
      </div>
    </div>

  </basic-container>
</template>

<script>
  import Reminders from '@/components/statistics-container/Reminders'
  import Complaint from '@/components/statistics-container/Complaint'
  import Abnormal from '@/components/statistics-container/Abnormal'
  import Refund from '@/components/statistics-container/Refund'
  import Problem from '@/components/statistics-container/Problem'
  import ProductAppeal from '@/components/statistics-container/ProductAppeal'
  import ConsultHappy from '@/components/statistics-container/ConsultHappy'
  import ModifyOrder from '@/components/statistics-container/ModifyOrder'
  import ModifyGoods from '@/components/statistics-container/ModifyGoods'
  export default {
    components: {
      Reminders,
      Complaint,
      Abnormal,
      Refund,
      Problem,
      ProductAppeal,
      ConsultHappy,
      ModifyOrder,
      ModifyGoods,
    },
    data() {
      return {
        active: 'Reminders', ////订单标签索引
        worktablist: [
          //订单标签切换数据
          {
            name: "催单统计",
            key: 'Reminders',
          },

          {
            name: "投诉统计",
            key: 'Complaint',
          },
          {
            name: "异常统计",
            key: 'Abnormal',
          },
          {
            name: "修改工单统计",
            key: 'ModifyOrder',
          },
          {
            name: "退款统计",
            key: 'Refund',
          },
          {
            name: "问题统计",
            key: 'Problem',
          },
          {
            name: "生产申诉",
            key: 'ProductAppeal',
          },
          {
            name: "咨询快乐工单",
            key: 'ConsultHappy',
          },
          {
            name: "修改款式工单",
            key: 'ModifyGoods',
          },
        ],
      }

    },
    methods: {
      handleTabs(item) { //切换订单标签数据
        this.active = item;
      }
    }

  }
</script>

<style lang='scss' scoped>
  .app-container {
    width: 100%;
    box-sizing: border-box;

    .worktablist {
      display: flex;
      margin-bottom: 10px;
        cursor: pointer;

      .name {
        padding: 0 15px;
        text-align: center;
        color: #000;
        font-size: 20px;
        line-height: 40px;

        &.active {
          font-size: 20px;
          color: #43a0ff;
          border-bottom: 1px solid #43a0ff;
        }
      }
    }
    .workMain{
      margin-bottom: 20px;
    }

  }
</style>
